\name{PlotDist}
\alias{PlotDist}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Plot Distributions}
\description{
  This function is designed to facilitate creating plots of different distributions.  It currently includes the following: "normal", "t", "F", "chisq", and "binomial".  In addition to plotting the distribution (based on relevant degrees of freedom, if necessary), it colors the "critical" or "rejection region" based on the specified \code{alpha} value.  If a filename is specified, it will print the plot to a PDF directly.  I made this primarily to create easy demonstrations in an introductory statistics course.
}
\usage{
PlotDist(alpha, from = -5, to = 5, n = 1000, filename = NULL,
  alternative = c("two.tailed", "greater", "lesser"),
  distribution = c("normal", "t", "F", "chisq", "binomial"),
  colour = "black", fill = "skyblue2", ...)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{alpha}{\code{alpha} sets the desired proportion of the distribution to fill in (the "critical region").
}
  \item{from}{\code{from} sets the lower bound of the distribution on the horizontal axis.
}
  \item{to}{\code{to} sets the upper bound of the distribution on the horizontal axis.
}
  \item{n}{\code{n} sets how many points should be calculated to create the "smooth" line of the distribution.  A higher number will take longer to calculate, but will result in a smoother line.
}
  \item{filename}{\code{filename} is \code{NULL} by default.  If it is set to a value, the plot will be printed as a PDF to that filename.
}
  \item{alternative}{\code{alternative} is a character vector giving the "alternative" hypothesis for the alpha.  That is should alpha be split up over both tails of the distribution ("two.tailed"), the left ("lesser") or the right ("greater").
}
  \item{distribution}{\code{distribution} is a string indicating which distribution to use.  Currently, only "normal", "t", "F", "chisq", and "binomial" are supported.
}
  \item{colour}{\code{colour} sets the color of the line plotting the distribution.
}
  \item{fill}{\code{fill} sets the color used to fill the \code{alpha} region.
}
  \item{\dots}{\code{\dots} additional arguments to be passed depending on the distribution (e.g., \code{df1} and \code{df2} for the F distribution).
}
}
\details{This is still a stub.}
\value{
None, called for its side effect of producing a plot.
}
%% \references{}
\author{Joshua Wiley, \url{http://joshuawiley.com/}}
\note{I have not tested this very much, so it is likely to be rather twitchy about what you try to do with it.}

%%\seealso{}
\examples{
## A normal distribution with the upper/lower 2.5\% filled in
PlotDist(alpha = .05, alternative = "two.tailed", distribution = "normal")

## F distribution on 4 and 22 degrees of freedom
PlotDist(alpha = .05, alternative = "greater", distribution = "F",
  df1 = 4, df2 = 22)

## But the defaults looked a little odd, perhaps we want
PlotDist(alpha = .05, from = 0, to = 5, alternative = "greater",
  distribution = "F", df1 = 4, df2 = 22)
}

% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{hplot}
